<template>
	<view>
		<image class="bg" src="../../static/img/bg_login.jpg"></image>
		<view class="footer">
			<button class="btn" open-type="getUserInfo" @getuserinfo="btGetUserInfo" withCredentials="true">微信授权登录</button>
			<view class="desc">
				<image class="check" src="../../static/img/icon_checked.png"></image>
				<text class="read">我已阅读并同意</text>
				<text @tap="btProtocol" class="pro">《瑞亚环球用户协议》</text>
			</view>
		</view>
	</view>
</template>

<script>
	
	import http from "@/common/http.js"
	import model from "@/common/model.js"
	
	export default {
		data() {
			return {
				code:"aaa",
				iv:"bbb",
				encryptedData:"ccc"
			}
		},
		onReady() {
			this.getOpenId();
		},
		methods: {
			getOpenId(){
				console.log("getopenid")
				http.post(model.getLoginUrl(),{
					code:this.code,
					iv:this.iv,
					encryptedData:this.encryptedData
				},(res)=>{
					console.log(res)
				},(err)=>{
					console.log(err)
				});
			},
			btGetUserInfo(e) {
				//..userInfo
				uni.switchTab({
					url:"../main/main"
				})
			},
			btProtocol(){
				console.log("打开协议")
			},
		},
	}
</script>

<style scoped lang="less">
	
	.bg{
		width: 750rpx;
		height: 1624rpx;
		position: fixed;
		top: 0;left: 0;right: 0;
	}
	.footer{
		z-index: 10;
		position: fixed;
		width: 750rpx;
		height: 320rpx;
		bottom: 0;left: 0;right: 0;
		background: white;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		.btn{
			width: 666rpx;
			height: 76rpx;
			line-height: 76rpx;
			background: black;
			color: #daceb1;
			font-size: 28rpx;
		}
		.desc{
			display: flex;
			flex-direction: row;
			align-items: center;
			margin-top: 60rpx;
			.check{
				width: 30rpx;
				height: 30rpx;
				margin-right: 25rpx;
			}
			.read{
				font-size: 24rpx;
				color: #0f2d41;
			}
			.pro{
				font-size: 24rpx;
				color: #614813;
			}
		}
	}
</style>
